/**
 * @author:linjiye
 * @date: 2025/3/30
 * @desc:
 **/

import {StyleSheet, Text, TextInput, View} from 'react-native'
import React from 'react'

type Props = {}

const FcSearch = ({onSearch,searchText,style}: Props) => {
    function handleSearch(val) {
        onSearch && onSearch(val)
    }
    return (
        // <TouchableOpacity onPress={() => router.navigate(`/search`)}>
        <View style={[styles.search_wrap,style]}>
          <Text style={{fontFamily: 'FcIconFont', fontSize: 20, color: '#000000', marginRight: 7}}>&#xe641;</Text>
          <TextInput style={styles.search} placeholder={'请输入要搜索内容'} text={searchText}
                     onChangeText={(val) => handleSearch(val)}
                     placeholderTextColor={'rgba(0, 0, 0, 0.3)'}/>
        </View>
        // </TouchableOpacity>
    )
}

export default FcSearch

const styles = StyleSheet.create({
  search_wrap: {
    flexDirection: 'row',
    alignItems: "center",
    backgroundColor: '#F1F2F4',
    borderRadius: 9,
    marginHorizontal: 16,
    height: 40,
    paddingHorizontal: 14
  },
  search: {
    flex: 1,
    height: '100%',
    color: 'rgba(0,0,0,0.9)'
  },
})